package com.pubinfo.passbook.common.model.dto.open;

import com.baomidou.mybatisplus.annotation.TableField;
import com.pubinfo.passbook.common.entity.TMdmSupplier;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@ApiModel(value = "RelateSupplier", description = "报账单供应商")
public class RelateSupplier implements Serializable {
  @ApiModelProperty(value = "供应商编码 该处可传送总账科目、供应商、客户，通过科目类型区分主数据属性")
  private String supplierCode = "G000343924";
  
  @ApiModelProperty(value = "供应商名称  非必须  该处可传送总账科目、供应商、客户，通过科目类型区分主数据属性")
  private String supplierName = "浙江省公路管理局";
  
  @ApiModelProperty(value = "科目类型  非必须  选输(1-总账、2-供应商、3-客户),有科目时必须")
  private Byte accountType;
  
  @ApiModelProperty(value = "金额  非必须  价款(不含税)")
  private Double sum;
  
  @ApiModelProperty(value = "进项税金额  必须  当“票据类型”为1、4、5、6、11时，进项税金额必须")
  private Double inputTaxSum;
  
  @ApiModelProperty(value = "发票金额")
  private Double invoiceSum;
  
  @ApiModelProperty(value = "是否挑对  非必须  总账科目挑对时，该relateSuppliers可同时存在总账科目跟供应商，isPicking为必填")
  private Byte isPicking;
  
  @TableField(exist = false)
  private static final long serialVersionUID = 1L;
  
  public RelateSupplier(TMdmSupplier supplier, Double sum) {
    this.supplierCode = supplier.getLifnr();
    this.supplierName = supplier.getName1();
    this.accountType = 2;
    this.sum = sum;
    this.invoiceSum = sum;
  }
}